package com.stm.bi.web;

import com.stm.bi.dto.query.ods.OdsProductInventoryQry;
import com.stm.bi.model.DatatablePage;
import com.stm.bi.service.WarehouseService;
import com.stm.framework.annotation.Module;
import com.stm.framework.annotation.ReqParam;
import com.stm.framework.annotation.RestApi;
import com.stm.framework.dto.Response;
import com.stm.framework.model.CustomizePage;
import com.stm.saas.dto.query.WarehousePageQry;
import com.stm.saas.dto.query.WarehouseRecordListQry;
import com.stm.saas.dto.vo.WarehouseQueryVO;
import com.stm.saas.dto.vo.WarehouseRecordVO;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 仓库信息-controller服务
 *
 * @author zhouyuanpeng
 * @date 2025-3-17
 */
@RestController
@RequestMapping("/warehouse")
@Module("仓库管理")
public class WarehouseController {
    @Resource
    private WarehouseService warehouseService;

    @GetMapping(value = "/selectPage")
    @RestApi(name = "仓库信息分页查询", author = "zhouyuanpeng", idx = 1, permission = "plan:warehouse:query")
    public Response<CustomizePage<WarehouseQueryVO>> selectPage(WarehousePageQry warehousePageQry) {
        return warehouseService.selectPage(warehousePageQry);
    }

    @GetMapping(value = "/selectWarehouseInventory")
    @RestApi(name = "仓库记录列表查询", author = "zhouyuanpeng", idx = 2, permission = "plan:warehouse:query")
    public Response<DatatablePage> selectWarehouseInventory(@RequestParam(required = false, name = "warehouseCode") @ReqParam(label = "仓库编码", required = true) String warehouseCode,
                                                            @RequestParam(required = false, name = "year") @ReqParam(label = "年份", required = true) String year) {
        return warehouseService.selectWarehouseInventory(warehouseCode, year);
    }

}
